﻿package com.wandian.controller
{
	import com.wandian.data.GameData;
	import com.wandian.view.mediator.TopMediator;
	
	import flash.display.MovieClip;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	/**   
	* @author long
	* @QQ 108232706
	* @version 1.0   
	*/   
	public class TopCommand extends SimpleCommand
	{
		private var _global:GameData;
		private var _mcTop:MovieClip;

		public function TopCommand()
		{
			this._global=GameData.getInstance();
			return;
		} 

		override public function execute(notification:INotification):void
		{
			super.execute(notification);
			this.showTop();
			return;
		} 

		private function showTop():void
		{
			if (!this._mcTop)
			{
				this._mcTop=GameData.getMovieClip("TopMc");
			}
			if (!Texas.I._mcTopView.contains(this._mcTop))
			{
				Texas.I._mcTopView.addChild(this._mcTop);
			}
			facade.registerMediator(new TopMediator(this._mcTop));
			return;
		} 

	}
}
